<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			let arr = [{
					id: 1,
					name: '小1',
					age: 11,
					gender: '男'
				},
				{
					id: 2,
					name: '小1',
					age: 21,
					gender: '男'
				},
				{
					id: 3,
					name: '小2',
					age: 23,
					gender: '男'
				},
				{
					id: 4,
					name: '小3',
					age: 23,
					gender: '女'
				},
				{
					id: 5,
					name: '小3',
					age: 3,
					gender: '女'
				},
				{
					id: 6,
					name: '小4',
					age: 23,
					gender: '男'
				}
			]
			
			let obj = {}
			arr = arr.reduce((pre,next) => {
				obj[next.name]? '' : (obj[next.name] = true && pre.push(next))
				return pre;
			},[])
			console.log(arr)
		</script>
	</body>
</html>
